from django.forms.models import model_to_dict



# 模型转字典
def utils_model_to_dict(model, *args, **kwargs):
    data = model_to_dict(model)
    
    set_info_js_path = kwargs.get("set_info_js_path", "")
    if set_info_js_path:
        data["set_info_js_path"] = set_info_js_path
    
    return data